package omm.util;

import java.util.Locale;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.DateTimeFormatterBuilder;

public class Graphics {
	public static String makeTitle(String graphic, DateTime beginning, DateTime ending){
		  DateTimeFormatter fmt = new DateTimeFormatterBuilder()
		  .appendMonthOfYearShortText()
		  .appendTwoDigitYear(1956)
		  .toFormatter();
		  
		  String range = "";
		  if(beginning.equals(ending)){
			  range = "("+beginning.toString(fmt.withLocale(new Locale("Es")))+")";
		  }else{
		  	  range = "("+beginning.toString(fmt.withLocale(new Locale("Es")))+"-"+ending.toString(fmt.withLocale(new Locale("Es")))+")";
		  }
		return graphic+range;
	}
	

}
